package cn.wolfcode.luowowo.article.service.impl;

import cn.wolfcode.luowowo.article.domain.Item;
import cn.wolfcode.luowowo.article.mapper.ItemMapper;
import cn.wolfcode.luowowo.article.service.IItemService;
import cn.wolfcode.luowowo.common.query.QueryObject;
import com.alibaba.dubbo.config.annotation.Service;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;

@Service
public class ItemServiceImpl implements IItemService {
   @Autowired
    private ItemMapper itemMapper;

    public PageInfo list(QueryObject qo) {
        PageHelper.startPage(qo.getCurrentPage(), qo.getPageSize());
        return new PageInfo(itemMapper.list());
    }

    public Item get(Long itemId) {
        return itemMapper.get(itemId);
    }

    public void update(Item item) {
        itemMapper.update(item);
    }
}
